//
//  gbTableViewCell.m
//  10-团购
//
//  Created by wangneihan on 15/12/18.
//  Copyright © 2015年 wangneihan. All rights reserved.
//

#import "gbTableViewCell.h"

@interface gbTableViewCell()

@property (weak, nonatomic) IBOutlet UIImageView *ImgView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UILabel *buCountLabel;


@end

@implementation gbTableViewCell

+(gbTableViewCell *)gbTableViewCellWithTableView:(UITableView *)tableView
{
    static NSString * reuseId = @"gb";
    gbTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseId];
    if(cell == nil)
    {
        cell =[[[NSBundle mainBundle]loadNibNamed:@"gbTableViewCell" owner:nil options:nil]lastObject];
    }
    return cell;
}

- (void)setGroupBuying:(GroupBuying *)groupBuying
{
    _groupBuying = groupBuying;
    
    self.titleLabel.text = groupBuying.title;
    self.priceLabel.text = [NSString stringWithFormat:@"￥ %@",groupBuying.price] ;
    self.buCountLabel.text = [NSString stringWithFormat:@"%@ 人已购买",groupBuying.buyCount];
    self.ImgView.image = [UIImage imageNamed:groupBuying.icon];
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
